package com.itheima.service;

import com.alibaba.dubbo.config.annotation.Service;
import com.itheima.dao.MenuDao;
import com.itheima.pojo.Menu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service(interfaceClass = MenuService.class)
@Transactional
public class MenuServiceImpl implements MenuService {
    @Autowired
    private MenuDao menuDao;
    //查询所有菜单信息
    public List<Menu> findAll() {
       List<Menu> data = menuDao.findAll();
        return data;
    }

    //根据角色id查询对应的菜单id
    public List<Integer> findMenuIdsByRoleId(Integer roleId) {

        return menuDao.findMenuIdsByRoleId(roleId);
    }
}
